package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.SupplierContactRecordMapper;
import com.ruoyi.crm.domain.SupplierContactRecord;
import com.ruoyi.crm.service.ISupplierContactRecordService;

/**
 * 供应商联系记录Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-31
 */
@Service
public class SupplierContactRecordServiceImpl implements ISupplierContactRecordService
{
    @Autowired
    private SupplierContactRecordMapper supplierContactRecordMapper;

    /**
     * 查询供应商联系记录
     *
     * @param id 供应商联系记录主键
     * @return 供应商联系记录
     */
    @Override
    public SupplierContactRecord selectSupplierContactRecordById(String id)
    {
        return supplierContactRecordMapper.selectSupplierContactRecordById(id);
    }

    /**
     * 查询供应商联系记录列表
     *
     * @param supplierContactRecord 供应商联系记录
     * @return 供应商联系记录
     */
    @Override
    public List<SupplierContactRecord> selectSupplierContactRecordList(SupplierContactRecord supplierContactRecord)
    {
        return supplierContactRecordMapper.selectSupplierContactRecordList(supplierContactRecord);
    }

    /**
     * 新增供应商联系记录
     *
     * @param supplierContactRecord 供应商联系记录
     * @return 结果
     */
    @Override
    public int insertSupplierContactRecord(SupplierContactRecord supplierContactRecord)
    {
        return supplierContactRecordMapper.insertSupplierContactRecord(supplierContactRecord);
    }

    /**
     * 修改供应商联系记录
     *
     * @param supplierContactRecord 供应商联系记录
     * @return 结果
     */
    @Override
    public int updateSupplierContactRecord(SupplierContactRecord supplierContactRecord)
    {
        supplierContactRecord.setUpdateTime(DateUtils.getNowDate());
        return supplierContactRecordMapper.updateSupplierContactRecord(supplierContactRecord);
    }

    /**
     * 批量删除供应商联系记录
     *
     * @param ids 需要删除的供应商联系记录主键
     * @return 结果
     */
    @Override
    public int deleteSupplierContactRecordByIds(String[] ids)
    {
        return supplierContactRecordMapper.deleteSupplierContactRecordByIds(ids);
    }

    /**
     * 删除供应商联系记录信息
     *
     * @param id 供应商联系记录主键
     * @return 结果
     */
    @Override
    public int deleteSupplierContactRecordById(String id)
    {
        return supplierContactRecordMapper.deleteSupplierContactRecordById(id);
    }
}